import request from '@/config/axios'

export interface ScoreManageVO {
  id: number
  code: string
  agentCode: string
  businessType: string
  employeeCode: string
  systemEmployeeCode:String
  employeeNickname: string
  performanceType: string
  beforeScore: number
  score: number
  afterScore: number
  reason: string
  remark: string
}

// 查询评分管理分页
export const getScoreManagePage = async (params) => {
  return await request.get({ url: `/meijia/score-manage/page`, params })
}

// 查询评分管理详情
export const getScoreManage = async (id: number) => {
  return await request.get({ url: `/meijia/score-manage/get?id=` + id })
}

// 新增评分管理
export const createScoreManage = async (data: ScoreManageVO) => {
  return await request.post({ url: `/meijia/score-manage/create`, data })
}

// 修改评分管理
export const updateScoreManage = async (data: ScoreManageVO) => {
  return await request.put({ url: `/meijia/score-manage/update`, data })
}

// 删除评分管理
export const deleteScoreManage = async (id: number) => {
  return await request.delete({ url: `/meijia/score-manage/delete?id=` + id })
}

// 导出评分管理 Excel
export const exportScoreManage = async (params) => {
  return await request.download({ url: `/meijia/score-manage/export-excel`, params })
}
export const getEmployeeList = async (employeeNickname) => {
  return await request.get({ url: `/meijia/score-manage/get-employee-list?employeeNickname=` + employeeNickname })
}

export const getScoreManagePageByEmployee = async (params) => {
  return await request.get({ url: `/meijia/score-manage/page-by-employee`,params })
}

export const getScoreManageStatisticsByEmployee = async (employeeCode) => {
  return await request.get({ url: `/meijia/score-manage/statistics-by-employee?employeeCode=` + employeeCode })
}